<template>
    <div>
        <van-search v-model="value" placeholder="请输入搜索关键词" />
        <van-tabs v-model:active="active">
            <van-tab title="精选"></van-tab>
            <van-tab title="本地"></van-tab>
            <van-tab title="新车"></van-tab>
            <van-tab title="原创"></van-tab>
            <van-tab title="视频看车"></van-tab>
            <van-tab title="导购"></van-tab>
        </van-tabs>
        <van-swipe :autoplay="3000" lazy-render>
            <van-swipe-item v-for="image in images" :key="image">
                <img :src="image" style="width: 80%;height: 200px;" />
            </van-swipe-item>
        </van-swipe>
        <van-grid>
            <van-grid-item v-for="item in catitems"  :icon="item.image_src" :text="item.name" />
        </van-grid>
        <div>
            <img src="./img/dc.png" alt="" style="width: 100%; height: 200px;">
        </div>
         <div>
            <img src="./img/sp.png" alt="" style="width: 100%; height: 200px;">
        </div>




    </div>
</template>

<script setup>
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
];
import { ref } from 'vue';
import { catitemsApi } from '@/api/api';
let catitems = ref([])
catitemsApi().then(res => {
    console.log('导航', res)
    catitems.value = res.data.message
})

</script>

<style lang="scss" scoped></style>